package com.sesamtv.decoder
{
	import flash.display.BitmapData;
	import flash.events.EventDispatcher;
	import flash.events.StatusEvent;
	import flash.external.ExtensionContext;
	
	
	public class VideoDecoderEx extends EventDispatcher
	{
		private var _context:ExtensionContext;
		
		public function VideoDecoderEx()
		{
			_context = ExtensionContext.createExtensionContext('com.sesamtv.decoder.VideoDecoderEx', '');
			_context.addEventListener(StatusEvent.STATUS, onExtensionContextStatus);
		}
		
		public function get context():ExtensionContext
		{
			return _context;
		}
		
		public function PreloadFile( pFilename:String ):String
		{
			return _context.call( "PreloadFile", pFilename ) as String;
		}
		
		public function Render(bitmapData:BitmapData):void
		{
			_context.call( "Render", bitmapData );
		}
		
		public function onExtensionContextStatus(e:StatusEvent):void
		{
			super.dispatchEvent(e);
		}
		
	}
}